package com.timesheet.gui.efforttracker.utils;

import java.util.ArrayList;
import java.util.List;

import com.timesheet.server.common.models.EffortTrackerDTO;
import com.timesheet.server.common.models.view.EffortTrackerViewModel;
import com.timesheet.server.core.mapper.Mapper3;

public class EffortTrackerUtil {

	public static List<EffortTrackerViewModel> convertDtoListToViewModelList(List<EffortTrackerDTO> effortsWSR) {
		List<EffortTrackerViewModel> effortTrackerViewModelsList = new ArrayList<EffortTrackerViewModel>();
		for (EffortTrackerDTO effortTrackerDTO : effortsWSR) {
			EffortTrackerViewModel viewModel = new EffortTrackerViewModel();
			effortTrackerViewModelsList.add(convertDto2ViewModel(effortTrackerDTO, viewModel));
		}

		return effortTrackerViewModelsList;
	}

	public static EffortTrackerDTO convertViewModel2Dto(EffortTrackerViewModel viewModel, EffortTrackerDTO dto) {
		EffortTrackerDTO map = Mapper3.map(dto, viewModel);
		return map;

	}

	public static EffortTrackerViewModel convertDto2ViewModel(EffortTrackerDTO dto, EffortTrackerViewModel viewModel) {
		EffortTrackerViewModel map = Mapper3.map(viewModel, dto);
		return map;

	}
	
	
	
	

}
